#include "input_method.h"
#include "phonekey_input.h"
#include "stdio.h"
#include <string.h>
void test__(void);
void main()
{
	char input_string[]={"bang"}; 
	char chines_string[100]; 
	char input[100];
	char *list;
	while(1)
	{
		list = NULL;
		memset(input,0,sizeof(input));
		gets(input);
		if(strlen(input) != 0)
			list = get_chinese_by_str(input);
		if(list == NULL)
			list = get_chinese_by_str(get_spell_by_num(input,0));
		if(list != NULL)
			printf("%-6s = %s\r\n",input,list);
		else
			printf("invalid string\r\n");
	}

	//test__();
	memset(chines_string,0,100);
	//sprintf(chines_string,"%s",get_chinese_by_str("bang")); 
	printf("%-6s = %s\r\n","9264",get_chinese_by_str(get_spell_by_num("9264",0)));
	printf("%-6s = %s\r\n","24826",get_chinese_by_str(get_spell_by_num("24826",0)));
	printf("%-6s = %s\r\n","8264",get_chinese_by_str(get_spell_by_num("8264",0)));
	printf("%-6s = %s\r\n","7464",get_chinese_by_str(get_spell_by_num("7464",0)));
	printf("%-6s = %s\r\n","7464",get_chinese_by_str(get_spell_by_num("7464",1)));
	printf("%-6s = %s\r\n","94664",get_chinese_by_str(get_spell_by_num("94664",0)));

	printf("%-6s = %s\r\n","qian",get_chinese_by_str("qian"));
	printf("%-6s = %s\r\n","zhuang",get_chinese_by_str("zhuang"));
	printf("%-6s = %s\r\n","se",get_chinese_by_str("se"));
	printf("%-6s = %s\r\n","ta",get_chinese_by_str("ta"));
	printf("%-6s = %s\r\n","sang",get_chinese_by_str("sang"));
	printf("%-6s = %s\r\n","man",get_chinese_by_str("man"));
}
